home *** CD-ROM | disk | FTP | other *** search
/ Whiteline: Alpha / Whiteline Alpha.iso / tex / tools / dvi_uni / macros.zoo / graphic.tex < prev    next >
Encoding:
Text File  |  1992-07-28  |  2.0 KB  |  74 lines

  1. % This is `graphic.tex' as of April 01, 1990 (no joke!) by Gerhard Wilhelms
  2. %
  3. % Simply say `\input graphic' at the beginning of your file, and you may
  4. % include graphics with `\includegraphic{<filename>}', where filename is
  5. % the name of your Postscript graphics file (<filename>.ps) resp. the companion
  6. % \TeX file (<filename>.tex). Usually the companion file will be created by
  7. % the Atari ST program imgtotex, but you can set it up by your own. You only
  8. % need to specify the actual width and height of the Postscript image using
  9. % the \TeX variables grwd for width and grht for height.
  10. %
  11. \newdimen\grwd \newdimen\grht
  12. \font\ninesl=cmsl9
  13. %
  14. % framing
  15. %
  16. \def\boxstuff#1#2#3{%
  17.   \vbox{\hrule height#2          %
  18.     \hbox{\vrule width#2         % #1=Abstand innen zum Rahmen
  19.       \hskip#1                   %
  20.       \vbox{\vskip#1{}           % #2=Rahmendicke
  21.         #3                       %
  22.       \vskip#1}                  % #3=eingerahmter Text o.ä.
  23.       \hskip#1                   %
  24.     \vrule width#2}              % Dank an Norbert Schwarz
  25.   \hrule height#2}               %
  26. }
  27. %
  28. % Bilder und Ähnliches
  29. %
  30. \def\labeledpicture#1#2{%
  31.   \midinsert            % #1=Bildinhalt
  32.   \vbox{                %
  33.   $$\vbox{              %
  34.   #1                    % #2=Bildtitel
  35.   }$$                   %
  36.   \smallskip
  37.   \centerline{\ninesl #2}
  38.   }
  39.   \endinsert
  40. }
  41.  
  42. \def\includegraphic #1{%
  43.  \input #1 % the companion \TeX\ file
  44.  \setgraphic{#1}{\the\grwd}{\the\grht}%
  45.  }
  46. %
  47. \def\setgraphic #1#2#3{%
  48.  \hbox to #2{\vbox to #3{\vfil\special{graphic img #1.img}}\hfil}%
  49.  }
  50.  
  51. \def\includeps #1{%
  52.  \input #1 % the companion \TeX\ file
  53.  \setpsgraphic{#1.ps}{\the\grwd}{\the\grht}%
  54.  }
  55. %
  56. \def\setpsgraphic #1#2#3{%
  57.  \hbox to #2{\vbox to #3{\vfil\special{ps #1}}\hfil}%
  58.  }
  59.  
  60.  
  61. \def\putpsgraphic #1#2#3{%
  62.  \hbox to #2{\vbox to #3{\special{ps #1}\vfil}\hfil}%
  63.  }
  64.  
  65. \def\psdraw #1{%
  66.  \input #1 % the companion \TeX\ file
  67.  \putpsgraphic{#1.pst}{\the\grwd}{\the\grht}%
  68.  }
  69.  
  70. \def\rpsdraw #1{%
  71.   \boxstuff{0pt}{0.5pt}{\psdraw{#1}}
  72.  }
  73.  
  74. ə